package com.huawei.spare.part.replace.framework;

import org.apache.commons.lang.StringUtils;

import static com.huawei.spare.part.replace.Constants.ViewPackage;
import static com.huawei.spare.part.replace.Constants.ViewTitlePrefix;

public abstract class SmartContentView extends SmartView {

    public SmartContentView() {
    }

    @Override
    public SmartContentPresenter getPresenter() {
        return (SmartContentPresenter) super.getPresenter();
    }

    public String getTitle() {
//        final String name = this.getClass().getName();
        final String packageName = this.getClass().getPackage().getName();
        final String path = StringUtils.substringAfter(packageName, ViewPackage);
        return bundle.getString(ViewTitlePrefix + path);
    }

}
